package com.doublefish.doublefishrobot.ui.video;

import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import com.doublefish.doublefishrobot.R;
import com.doublefish.doublefishrobot.base.BaseActivity;
import com.doublefish.doublefishrobot.utils.AppCacheUtil;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 作者:dugaofeng on 2024/10/31 09:17
 */
public class VideoSettingMenuActivity extends BaseActivity {

    @BindView(R.id.tv_title)
    TextView titleTv;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_video_setting_menu;
    }

    @Override
    protected void initView() {
        titleTv.setText(R.string.video_setting);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initListener() {

    }

    @OnClick({R.id.ll_video_setting, R.id.ll_clear_videos})
    public void onViewClick(View view) {
        switch (view.getId()) {
            case R.id.ll_video_setting: {
                toDownloadSettingActivity();
            }
            break;

            case R.id.ll_clear_videos: {
                prepareToVideoClearActivity();
            }
            break;
        }
    }

    @OnClick(R.id.tv_back)
    public void onBackBtnClick() {
        finish();
    }

    private void toDownloadSettingActivity() {
        Intent intent = new Intent(this, VideoDownloadSettingActivity.class);
        startActivity(intent);
    }

    private void prepareToVideoClearActivity() {
        if (AppCacheUtil.getInstance().isStoragePermissionEnable()) {
            toVideoClearActivity();
        } else {
            //请求存储权限
            checkStoragePermission();
        }
    }

    private void toVideoClearActivity() {
        Intent intent = new Intent(this, VideoClearActivity.class);
        startActivity(intent);
    }
}
